/*
 * Copyright (c) 2023 vitasystems GmbH
 *
 * This file is part of project EHRbase Migration Tool
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.ehrbase.migration.exporter.v0.jooq.pg.udt;

import org.ehrbase.migration.exporter.v0.jooq.pg.Ehr;
import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.CodePhraseRecord;
import org.ehrbase.migration.exporter.v0.jooq.pg.udt.records.DvCodedTextRecord;
import org.jooq.Schema;
import org.jooq.UDTField;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.SchemaImpl;
import org.jooq.impl.UDTImpl;

/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({"all", "unchecked", "rawtypes"})
public class DvCodedText extends UDTImpl<DvCodedTextRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ehr.dv_coded_text</code>
     */
    public static final DvCodedText DV_CODED_TEXT = new DvCodedText();

    /**
     * The class holding records for this type
     */
    @Override
    public Class<DvCodedTextRecord> getRecordType() {
        return DvCodedTextRecord.class;
    }

    /**
     * The attribute <code>ehr.dv_coded_text.value</code>.
     */
    public static final UDTField<DvCodedTextRecord, String> VALUE =
            createField(DSL.name("value"), SQLDataType.CLOB, DV_CODED_TEXT, "");

    /**
     * The attribute <code>ehr.dv_coded_text.defining_code</code>.
     */
    public static final UDTField<DvCodedTextRecord, CodePhraseRecord> DEFINING_CODE = createField(
            DSL.name("defining_code"),
            org.ehrbase.migration.exporter.v0.jooq.pg.udt.CodePhrase.CODE_PHRASE.getDataType(),
            DV_CODED_TEXT,
            "");

    /**
     * The attribute <code>ehr.dv_coded_text.formatting</code>.
     */
    public static final UDTField<DvCodedTextRecord, String> FORMATTING =
            createField(DSL.name("formatting"), SQLDataType.CLOB, DV_CODED_TEXT, "");

    /**
     * The attribute <code>ehr.dv_coded_text.language</code>.
     */
    public static final UDTField<DvCodedTextRecord, CodePhraseRecord> LANGUAGE = createField(
            DSL.name("language"),
            org.ehrbase.migration.exporter.v0.jooq.pg.udt.CodePhrase.CODE_PHRASE.getDataType(),
            DV_CODED_TEXT,
            "");

    /**
     * The attribute <code>ehr.dv_coded_text.encoding</code>.
     */
    public static final UDTField<DvCodedTextRecord, CodePhraseRecord> ENCODING = createField(
            DSL.name("encoding"),
            org.ehrbase.migration.exporter.v0.jooq.pg.udt.CodePhrase.CODE_PHRASE.getDataType(),
            DV_CODED_TEXT,
            "");

    /**
     * The attribute <code>ehr.dv_coded_text.term_mapping</code>.
     */
    public static final UDTField<DvCodedTextRecord, String[]> TERM_MAPPING =
            createField(DSL.name("term_mapping"), SQLDataType.CLOB.array(), DV_CODED_TEXT, "");

    /**
     * No further instances allowed
     */
    private DvCodedText() {
        super("dv_coded_text", null, null, false);
    }

    @Override
    public Schema getSchema() {
        return Ehr.EHR != null ? Ehr.EHR : new SchemaImpl(DSL.name("ehr"));
    }
}
